<?php

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

class Base extends Model
{

    protected $pk = 'id';

    protected $strice = false;

    //自动写入时间戳
    protected $autoWriteTimestamp = true;

    //启用软删除
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;


    // 设置json类型字段
	//protected $json = ['info'];

    /**
     * @return static
     */
    public static function getInstance(): self
    {
        return new static();
    }

    /**
     * @param array $scope
     * @return BaseQuery
     * @author xaboy
     * @day 2020-03-30
     */
    public static function getDB(array $scope = [])
    {
        return self::getInstance()->db($scope);
    }
}
